import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Chart from '../views/Chart.vue'
import User from '../views/User.vue'
import Type from '../views/Type.vue'
import Tag from '../views/Tag.vue'
import Collect from '../views/Collect.vue'
import Follow from '../views/Follow.vue'
import Blog from '../views/Blog.vue'
import Comment from '../views/Comment.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/login' },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      { path: 'chart', name: 'Chart', component: Chart },
      { path: 'user', name: 'User', component: User },
      { path: 'type', name: 'Type', component: Type },
      { path: 'tag', name: 'Tag', component: Tag },
      { path: 'collect', name: 'Collect', component: Collect },
      { path: 'follow', name: 'Follow', component: Follow },
      { path: 'blog', name: 'Blog', component: Blog },
      { path: 'comment', name: 'Comment', component: Comment },
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
